<html>
<head>
<title>Edit a record of member_imore</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link media="all" href="/cms/css/cms.min.css" type="text/css" rel="stylesheet" /> 
<link rel="stylesheet" type="text/css" href="/cms/css/tag/token-input.css" />
<script  type="text/javascript" src="/cms/js/cms.1.1.min.js"></script>
<script type="text/javascript" src="/cms/js/tag/jquery.tokeninput.js"></script>
<script language="JavaScript" src="/cms/js/cleditor/jquery.cleditor.min.js"></script>
<!--change to auto add JS later-->
<script language="JavaScript" src="/cms/js/jquery.validate.js"></script>
<script language="JavaScript" src="/cms/js/autocomplete/textarea.js"></script>

<link media="all" href="/cms/js/jcrop/css/jquery.Jcrop.css" type="text/css" rel="stylesheet"> 
</head>

<body>
{#include file="$navigation"#}
<div style="float:right;" id="login"></div>
<script>
$(document).ready(function() {	

});	
  function validate_form(form){
	  if (validator.form())  form.submit(); else alert('Some fields has error. Please check and resubmit');
  }
</script>

<H1><span id="parent_key_label"></span>Edit a record of  Member imore</H1>
<form name="form_edit" id="form_edit" method="post" action="{#$self_url#}" >	
<div class='tableWrapper' style="width:100%;margin:0;padding:0;">
  <div class='tableHeader' >

	<ul class="tableActions">
	
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存 " onclick="form.subaction.value='edit_after_update'; form.submit();" type="button"></li>
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" type="submit" name="Submit" value=" 確定 "></li>
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="dummy" value=" 取消 " onclick="javascript:window.location.href='{#$self_url#}/list'" type="button"></li>  

	</ul>

  <div class='clear'></div>
  <div class='corner left'></div>
  <div class='corner right'></div>
  </div>	
	
<table border="0" cellspacing='0' >
<tr id="tr_id"><td><B>id</B></td>
<td id="td_id">{#$edit_data.id#}</td></tr>
<tr id="tr_username"><td><B>username</B></td>
<td id="td_username">{#$edit_data.username#}</td></tr>
<tr id="tr_photo"><td><B>photo</B></td>
<td id="td_photo">{#$edit_data.photo#}</td></tr>
<tr id="tr_member_type"><td><B>會員分類</B></td>
<td id="td_member_type">{#$edit_data.member_type#}&nbsp;&nbsp;系統自動設定，如非必要，請勿修改。</td></tr>
<tr id="tr_info"><td><B>info</B></td>
<td id="td_info">{#$edit_data.info#}</td></tr>
<tr id="tr_email"><td><B>email</B></td>
<td id="td_email"><input type="text" id="field_email" name="email"  size="80" value="{#$edit_data.email#}"></td></tr>
<tr id="tr_logintime"><td><B>logintime</B></td>
<td id="td_logintime">{#$edit_data.logintime#}</td></tr>
<tr id="tr_regip"><td><B>regip</B></td>
<td id="td_regip">{#$edit_data.regip#}</td></tr>
<tr id="tr_phone"><td><B>phone</B></td>
<td id="td_phone"><input id="field_phone" type="text" name="phone" value="{#$edit_data.phone#}"></td></tr>
<tr id="tr_email_status"><td><B>電郵已確認？</B> <img src="/cms/images/ico/info.gif" class="tips" title="1: 已確認 （TBC With Denis)" /></td>
<td id="td_email_status">{#$edit_data.email_status#}</td></tr>
<tr id="tr_expert_approval"><td><B>expert_approval</B></td>
<td id="td_expert_approval">{#$edit_data.expert_approval#}</td></tr>
<tr id="tr_expert_reject_reason"><td><B>拒絕原因</B></td>
<td id="td_expert_reject_reason"><textarea name="expert_reject_reason" id="field_expert_reject_reason" cols="80" rows="2">{#$edit_data.expert_reject_reason#}</textarea>&nbsp;&nbsp;拒絕體驗達人申請原因</td></tr>
<tr id="tr_last_expert_approval_type"><td><B>最後發出會員註冊電郵</B></td>
<td id="td_last_expert_approval_type">{#$edit_data.last_expert_approval_type#}</td></tr>
<tr id="tr_acttime"><td><B>acttime</B></td>
<td id="td_acttime"><input id="field_acttime" type="text" name="acttime" value="{#$edit_data.acttime#}"></td></tr>
<tr id="tr_salutation"><td><B>稱謂</B></td>
<td id="td_salutation">{#$edit_data.salutation#}</td></tr>
<tr id="tr_birthday"><td><B>birthday</B></td>
<td id="td_birthday"><input id="field_birthday" type="text" name="birthday" value="{#$edit_data.birthday#}"></td></tr>
<tr id="tr_idcard"><td><B>idcard</B></td>
<td id="td_idcard"><input id="field_idcard" type="text" name="idcard" value="{#$edit_data.idcard#}"></td></tr>
<tr id="tr_email_receive"><td><B>email_receive</B></td>
<td id="td_email_receive"><input id="field_email_receive" type="text" name="email_receive" value="{#$edit_data.email_receive#}"></td></tr>
<tr id="tr_expert_application_reject_type"><td><B>expert_application_reject_type</B></td>
<td id="td_expert_application_reject_type"><input id="field_expert_application_reject_type" type="text" name="expert_application_reject_type" value="{#$edit_data.expert_application_reject_type#}"></td></tr>
<tr id="tr_status"><td><B>上線狀態</B></td>
<td id="td_status">{#$edit_data.status#}</td></tr>
<tr id="tr_addtime"><td><B>建立時間</B></td>
<td id="td_addtime">{#$edit_data.addtime#}</td></tr>
<tr id="tr_lastmodify"><td><B>更新時間</B></td>
<td id="td_lastmodify">{#$edit_data.lastmodify#}</td></tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="hidden" name="id" value="{#$edit_data.id#}">
     	
    <input type="hidden" name="action" value="update"><input name="subaction" type="hidden">
	<ul class="tableActions">
    
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存 " onclick="form.subaction.value='edit_after_update'; form.submit();" type="button"></li>
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" type="submit" name="Submit" value=" 確定 "></li>
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="dummy" value=" 取消 " onclick="javascript:window.location.href='{#$self_url#}/list'" type="button"></li>  

	</ul>
  </td>
  </tr>
</table>

</form> 

<script type="text/javascript">
$(function(){
  $(".tips").tipTip({defaultPosition: "right", edgeOffset: 10});
});
</script>

<script type="text/javascript">
//$(function(){
//});

//$(document).ready(function() {	
//});
</script>

<script type="text/javascript">

function hidden_rows_by_type(type){

  var myArray = [
    ['n_coming_issue'], // group 2
    [ 'fix_issue'] ,  // group 1
  ];

  for (var i=0; i<myArray.length; i++) {
    if (type == i + 1){
       for (var j=0; j<myArray[i].length; j++){
         $('#tr_'+myArray[i][j]).show();
       }
    } else {
       for (var j=0; j<myArray[i].length; j++){
        $('#tr_'+myArray[i][j]).hide();
       }
    }
  }
}

$(document).ready(function() {	
	var type = parseInt($('[name|="expert_approval"]').val());
	//hidden_rows_by_type(type);
        if(type == 6){
             $("#tr_expert_reject_reason").show();
        }else{
             $("#tr_expert_reject_reason").hide();
        }

	$('[name|="expert_approval"]').change(function() {
		//hidden_rows_by_type(parseInt($(this).val()));
             if(parseInt($(this).val()) == 6){
                $("#tr_expert_reject_reason").show();
             }else{
                $("#tr_expert_reject_reason").hide();
           }
	});

});

</script>
<!--POSTRUNJS-->
</body>
</html>
